﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.dgvProgrammer.AutoGenerateColumns = false;
        }
        //该泛型是保存所有程序员员工的信息
        public List<SE> programmerList = new List<SE>();
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            FrmAdd add = new FrmAdd();
            add.Choice = 0;
            add.FrmParent = this;
            add.ShowDialog ();
        }

        private void tsbModify_Click(object sender, EventArgs e)
        {
            FrmAdd add = new FrmAdd();
            add.Choice = 1;
            add.FrmParent = this;
            add.ShowDialog();
        }

        private void tsbRecord_Click(object sender, EventArgs e)
        {
            FrmRecord record = new FrmRecord();
            record.ShowDialog();
        }

        public void BindGrid(List<SE> list) 
        {
            this.dgvProgrammer.DataSource = new BindingList<SE>(list);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

      

        private void tsbDelete_Click(object sender, EventArgs e)
        {
            FrmDel del = new FrmDel();
            del.FrmParent = this;
            del.ShowDialog();

        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            string keywords=txtID.Text;
            FrmSearch sea = new FrmSearch(keywords);
            sea.FrmParent = this;
            sea.ShowDialog();

        }
    }
}
